<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>

<script src="${base}/js/crytojs/components/core.js"></script>
<script src="${base}/js/crytojs/components/enc-base64.js"></script>





<script>

	// base64 encrypt
	var rawStr = "hello world!/+=";
	var wordArray = CryptoJS.enc.Utf8.parse(rawStr);
	var base64 = CryptoJS.enc.Base64.stringify(wordArray);
	console.log('base64Encrypt = ', base64);
	
	// base64 decrypt
	var parsedWordArray = CryptoJS.enc.Base64.parse(base64);
	var parsedStr = CryptoJS.enc.Utf8.stringify(parsedWordArray);
	console.log('base64Decrypt = ',parsedStr);
    
    
    function encode(word){
    	var wordArray = CryptoJS.enc.Utf8.parse(rawStr);
    	var base64 = CryptoJS.enc.Base64.stringify(wordArray);
        return base64;
    }
    
    function decode(encodeStr){
    	var parsedWordArray = CryptoJS.enc.Base64.parse(encodeStr);
    	var parsedStr = CryptoJS.enc.Utf8.stringify(parsedWordArray);
        return parsedStr;
    }
    

	function decodeBack(){
		var keyword = encode("https://www.baidu.com/+=");
		window.open("${base}/crytoBase64/decode?keyword="+keyword);
	}
</script>    
</head>
<body>
 <h1>F12请看console</h1>
 <input  type="button"   onclick="decodeBack()"  value="后端解密">
</body>
</html>